<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>
  <body>
    <!-- 1.函数的默认值 -->
    <script>
      // es5 默认值
      // function say(a, b) {
      //   var b = b || 100
      //   console.log(a, b)
      // }
      // say(100)
      // es6 默认值
      function say(a, b = 100, c) {
        console.log(a, b, c)
      }
      say(100, 80, 100)
      //剩余参数  ...b 必须放在形参的最后位置
      function run(a, ...b) {
        console.log(a, b)
      }
      run(1, 2, 3, 4, 5)
    </script>
  </body>
</html>
